﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Data;
using System.Data.SqlClient;

namespace DAL
{
    /// <summary>
    /// Summary description for DADanhMucChung
    /// </summary>
    public class DADanhMucChung:DbObject
    {
        protected SqlConnection conn;
        public DADanhMucChung(SqlConnection Conection)
        {
            conn = Conection;
            //
            // TODO: Add constructor logic here
            //
        }

        public DataSet get_danh_sach_by_ma(string ip_str_ma_loai)
        {
            DataSet op_ds_bang_diem_hv = new DataSet();
            SqlParameter[] parameters =  {	
                                             new SqlParameter("@MaLoai", SqlDbType.VarChar, 20)
										 };
            // set the 0values
            parameters[0].Value = ip_str_ma_loai;
            // create the parameter
            op_ds_bang_diem_hv = RunProcedure("pr_TB_DMChung_get_ds_by_ma", parameters, "TB_DanhMucChung", conn);
            return op_ds_bang_diem_hv;
        }

        public DataSet get_danh_sach_by_nhieu_loai_ma(string ip_str_ma_loai)
        {
            DataSet op_ds_bang_diem_hv = new DataSet();
            SqlParameter[] parameters =  {	
                                             new SqlParameter("@MaLoai", SqlDbType.VarChar, 200)
										 };
            // set the 0values
            parameters[0].Value = ip_str_ma_loai;
            // create the parameter
            op_ds_bang_diem_hv = RunProcedure("pr_TB_DMChung_get_ds_by_nhieu_ma", parameters, "TB_DanhMucChung", conn);
            return op_ds_bang_diem_hv;
        }
    }
}